<template>
    <div class="big-digit" :class="{ 'no-bg': value === '.' }">
        <img class="bg" src="./border.svg" alt="">
        <Transition name="switch">
            <div class="content" :key="value">
                {{ value }}
            </div>
        </Transition>
    </div>
</template>

<script>
import { defineComponent } from 'vue'
export default defineComponent({
    props: {
        value: String,
    }
})

</script>

<style scoped>
.switch-enter {
    opacity: 0;
    transform: translateY(100%);
}

.switch-enter-to {}

.switch-enter-active,
.switch-leave-active {
    transition: all 500ms;
    position: absolute;
}

.switch-leave {}

.switch-leave-to {
    opacity: 0;
    transform: translateY(-100%);
}

.big-digit {
    height: 60px;
    width: 43px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.bg {
    position: absolute;
    box-sizing: border-box;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    user-select: none;
    pointer-events: none;

}

.content {
    font-family: 'OPPOSans';
    font-style: normal;
    font-weight: bolder;
    font-size: 40px;
    line-height: 40px;

    color: #E1F7FF;
    text-shadow: 0px 0px 6px rgba(225, 247, 255, 0.4);
    text-align: center;
}

.big-digit.no-bg {
    width: 17px;
}

.no-bg .bg {
    display: none;
}

.no-bg .content {
    font-weight: bolder;
    font-size: 50px;
    line-height: 50px;
    position: relative;
    top: -3px;
}
</style>